package
{
	import com.greensock.events.LoaderEvent;
	import com.greensock.loading.ImageLoader;
	import com.greensock.loading.LoaderMax;
	import com.greensock.loading.XMLLoader;
	import com.greensock.loading.display.ContentDisplay;

	import flash.display.Sprite;

	[SWF(width="600", height="600", frameRate="30", backgroundColor="0xFFFFFF")]
	public class loder_Test extends Sprite
	{
		public function loder_Test()
		{
			LoaderMax.activate([ImageLoader]);

			var queue:LoaderMax = new LoaderMax({name: "mainQueue",
					onProgress: progressHandler,
					onComplete: completeHandler,
					onError: errorHandler});

			queue.append(new XMLLoader("doc.xml", {name: "xmlDoc"}));
			queue.load();


		}

		private function progressHandler($event:LoaderEvent):void
		{
			trace("progressHandler: " + $event.target.progress);

		}

		private function completeHandler($event:LoaderEvent):void
		{
			trace("completeHandler");
			var photo:ContentDisplay = LoaderMax.getContent("photo1");
			this.addChild(photo);

			var photo2:ContentDisplay = LoaderMax.getContent("photo2");
			this.addChild(photo2);
			photo2.y = photo.width;
		}

		private function errorHandler($event:LoaderEvent):void
		{
			trace("errorHandler");
		}
	}
}